package com.yang.designmode.singleton;

public class LazySingletonTest {
    public static void main(String[] args) {
        System.out.println("懒汉式单例并发场景测试");
        for (int i = 0; i < 100; i++) {
            new Thread(() -> {
                try {
                    System.out.println(LazySingleton.getInstance());
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }).start();
        }
    }
}
